package com.cvte.sunkit.utils

import com.kongzue.dialogx.dialogs.PopTip
import com.kongzue.dialogx.style.MaterialStyle

/**
 * @ClassName PopTipUtils
 * @Description 气泡请提示
 * @Author lixu
 * @Data 2023/7/22 19:13
 * @Version 1.0
 */
object PopTipUtils {
    var LONG: Int = 1
    var SHORT: Int = 0

    fun errMsg(msg: String, time: Int = SHORT) {
        if (time == LONG) {
            PopTip.build(MaterialStyle.style()).setMessage(msg).iconError().showLong()
        } else {
            PopTip.build(MaterialStyle.style()).setMessage(msg).iconError().show()
        }
    }


    fun successMsg(msg: String, time: Int = SHORT) {
        if (time == LONG) {
            PopTip.build(MaterialStyle.style()).setMessage(msg).iconSuccess().showLong()
        } else {
            PopTip.build(MaterialStyle.style()).setMessage(msg).iconSuccess().show()
        }
    }


    fun warnMsg(msg: String, time: Int = SHORT) {
        if (time == LONG) {
            PopTip.build(MaterialStyle.style()).setMessage(msg).iconWarning().showLong()
        } else {
            PopTip.build(MaterialStyle.style()).setMessage(msg).iconWarning().show()
        }
    }
}